/**
 * stackoverflow.c
 * Overwrite return area of a function stack, redirect to
 * other function.
 * @author: zt  2013-08-08
 */
#include<stdio.h>
#include<stdlib.h>
//#include<iostream>
//
//using namespace std;

//int main(void);

void hello()
{
	printf("hello\n");
	return ;
}

int stackOverflow(int a, int b)
{
	int buf[2] = {1,2};
	int *p;
	p = &a - 1;
	*p = (int)hello;
	return 0;
}

int MyFunc(int parameter1, char parameter2)
{
	int local1 = 9;
	char local2 = 'z';
	return 0;
}

//int main(void)
//{
//	MyFunc(7, '8');
//	stackOverflow(1, 2);
//
//	getchar();
//	return EXIT_SUCCESS;   
//}
